<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php if(count($items) > 0){?>
<br />
<table class="tbl-list tbpadd" width="100%" border="1">
	<tr>
		<td width="5%" class="td-label" style="text-align:center">
			<b>#</b>
		</td>
		<td width="30%" class="td-label">
			<b>Tên Chiến dịch</b>
		</td>
		<td class="td-label">
			<b>Tên Quảng cáo</b>
		</td>
		<td class="td-label">
			<b>Ngày hạ</b>
		</td>
	</tr>
	<?php foreach ($items as $i => $item){?>
	<tr class="row">
		<td style="text-align:center">
			<?php echo ($i + 1) + ($page - 1)*$limit;?>
		</td>
		<td>
			<a href="<?php echo site_url('campaigndetail/?campaignid='.$item->campaignid.'&fromdate='.$fromdate.'&todate='.$todate);?>" target="_blank">
				<?php echo $item->campaignname;?>
			</a>
		</td>
		<td>
			<a href="<?php echo site_url('bannerdetail/?bannerid='.$item->bannerid.'&fromdate='.$fromdate.'&todate='.$todate);?>" target="_blank">
				<?php echo $item->bannername;?>
			</a>
		</td>
		<td>
			<?php $date = new DateTime($item->timedown); echo $date->format('d-m-Y H:i:m');?>
		</td>
	</tr>
	<?php }?>
	<tr>
		<td colspan="4" class="td-label text-right">
			Trang <select id="tracking-pagination" onchange="trackingBannerView(this.options[this.selectedIndex].value);">
			<?php for ($i = 1; $i <= $pages; $i++){?>
				<option value="<?php echo $i;?>" <?php if($i == $page) echo 'selected="selected"';?>><?php echo $i;?></option>
			<?php }?>
			</select> / <?php echo $pages;?> trang.
		</td>
	</tr>
</table>
<script type="text/javascript">
$(function(){
	$('.tbl-list .row').mouseover(function(){
		$(this).css('background','#ffc');
	});
	$('.tbl-list .row').mouseout(function(){
		$(this).css('background','none');
	});
});
</script>
<?php }?>